package bookshop.dao;

import java.util.List;

import bookshop.domain.CartItem;
import bookshop.domain.OrderInfo;
import bookshop.domain.OrderItem;
import bookshop.domain.SaleBook;
import bookshop.service.helper.OrderQueryHelper;

public interface OrderDao {

	// 添加订单信息
	void AddOrderInfo(OrderInfo orderInfo);

	// 添加order_item
	void saveOrderItem(OrderItem orderItem);

	//根据查询条件查询订单信息
	List<OrderInfo> GetOrderInfoByCondition(OrderQueryHelper helper);
	
	
	//根据查询条件以及分页查询订单信息
	List<OrderInfo> getScopedOrders(OrderQueryHelper helper,int startIndex,
			int fetchSize);
	
	//根据查询条件统计总共的订单数量
	Long countOrdersByCondition(OrderQueryHelper helper);
	
	//根据订单号取得相应的order——item
	List<OrderItem> GetOrderItemByOrderId(String orderId);
	
	//根据订单号删除订单
	void DelOrder(String orderId);
	
	//删除orderitem
	void DelOrderItem(String orderId);
	
	//更新订单
	void UpdateOrder(OrderInfo orderInfo);
	
	//根据订单号取出订单信息
	OrderInfo GetOrderByOrderId(String orderId);
	
	
	List<SaleBook> GetSaleBook();
	
	List<OrderItem> GetSalesBook();
}
